Copyright(C) 1994 Terumasa KODAKA , Takeshi KONO


■Printer BIOS

                 Printer interface overview

                 Machines equipped with IEEE STD 1284 include PC-9801BA2, BS2, BX2, NS/A, PC-9821Ap2, As2, Bf, Bp,
                 Bs, Be, Ts, Cs2, Ce2 (models other than PC-H98 that use a 36P half-pitch Amphenol connector for the printer connector).

               u When a 98 Hi-Res board (PC-9821A-E02) is installed on a machine equipped with IEEE STD 1284, the printer
                 interface on the 98 Hi-Res board is always used. Therefore, in normal mode, it is only for simple Centronics,
                 and in high-resolution mode, it is only for full Centronics.
               o On machines equipped with IEEE STD 1284 (normal) and PC-H98 (normal), the printer interface can be switched to full Centronics mode.
                 In this case, the functions for high resolution cannot be used, but care must be taken because the exit status returned after
                 BIOS execution is the same as that of full Centronics for high resolution. For this reason, the exit status is
                 classified into simple Centronics and full Centronics.
               u When connecting an EPSON printer in full Centronics mode, it is necessary to use an EPSON cable. Since the terminal
                 number that outputs +5V on the Centronics interface of EPSON printers is different from that of the PC-PR series,
                 This is because if you use an NEC cable, the printer will not recognize that it is turned on.

Table            Available printer interfaces and model correspondence
                 -------------------------------+-----------------------+-----------------+-------------------+------------
                 Model type                     | Input/output function | Full Centronics | Simple Centronics | ODA printer
                 -------------------------------+-----------------------+-----------------+-------------------+------------
                 IEEE STD 1284 equipped machine |           ○           |        ○        |         ○         |      ×
                 -------------------------------+-----------------------+-----------------+-------------------+------------
                 PC-H98 normal                  |           ×           |        ○        |         ○         |      ×
                 -------------------------------+-----------------------+-----------------+-------------------+------------
                 Hi-res (including PC-H98)      |           ×           |        ○        |         ×         |      ×
                 -------------------------------+-----------------------+-----------------+-------------------+------------
                 Normal (except PC-H98)         |           ×           |        ×        |         ○         |      ×
                 -------------------------------+-----------------------+-----------------+-------------------+------------
                 PC-98LT/HA                     |           ×           |        ×        |         ○         |      ×
                 -------------------------------+-----------------------+-----------------+-------------------+------------
                 PC-9801 First Generation/E/F/M |           ×           |        ×        |         ○         |      ○
                 -------------------------------+-----------------------+-----------------+-------------------+------------
               * The PC-9801 First Generation/E/F/M uses the ODA printer
                 interface (PC-9801-05) when memory switch 3 bit 5=1. It is undocumented that the PC-9801E/F/M can use the ODA printer.
               * On PC-9801U/VM2/VF, when memory switch 3 bit 5=1, executing the printer BIOS returns to AH=00h without doing anything.


INT 1Ah - Function 10h
Classification   PRINTER BIOS
Name             Initialization
Target           Normal, Hi-Res, PC-98LT/HA
Input            AH=10h
Output           ■Simple Centronics mode
                   AH=End status
                     00h: Printer BUSY
                     01h: Data can be sent
                 ■Full Centronics mode
                   AH=End status
                     00h: Data can be sent
                     01h: BUSY
                     03h: Offline
                     04h: Paper end
                     05h: Printer not connected or power OFF
                   AL=Printer port status (see INT 1Ah - Function 12h)
Explanation    o Initializes the printer interface.
                 The printer interface mode does not change even if this function is executed.
               o In Hi-Res mode, the printer BUSY wait time is set to 4 seconds.
                 o In Full Centronics mode, INPUT PRIME is activated for a period of 26 ms or more.
               u In the printer BIOS, after system startup, functions such as sending can be used without executing this function.
                 However, in high-resolution mode, the initial value of the printer BUSY wait time after startup is set to 0 (no timeout).
               o The current printer status is returned in AH and AL.
               o In simple Centronics mode, if the printer is powered off or not connected, this is not detected, so AH=01h is returned.
                 Simple Centronics mode can only detect the BUSY state.
Related          0000:041Ch[Hi-Res]


INT 1Ah - Function 11h
Classification   PRINTER BIOS
Name             Data output (wait mode)
Target           Normal, Hi-Res, PC-98LT/HA
Input            AH=11h
                 AL=Output data
Output           ■Simple Centronics mode
                   AH=End status
                     01h: Data transmission complete
                     02h: Unable to transmit due to timeout
                   AL=Undefined
                 ■Full Centronics mode
                   AH=End status
                     00h: Data transmission complete
                     02h: Unable to transmit due to timeout
                     03h: Offline
                     04h: Paper end
                     05h: Printer not connected or power off
                   AL=Printer port status (see INT 1Ah - Function 12h)
Explanation    o When data can be sent to the printer, 1 byte of data is output.
                 If the BUSY state continues for a certain period of time, it times out and returns.
                 In Hi-Res mode, the timeout period can be set with INT 1Ah - Function 16h.
               o In simple Centronics mode, if the printer is powered off or not connected, this is not detected and AH=01h is returned.
                 Simple Centronics mode can only detect the BUSY state.
               u The technical data book states that AH=00h is returned when the printer is BUSY in simple Centronics mode,
                 but in reality 00h is never returned.
Related          INT 1Ah - Function 16h
                 INT 1Ah - Function 30h
                 0000:041Ch[High-resolution]
                 I/O 0040h
                 I/O 0140h[IEEE STD 1284 equipped device]


INT 1Ah - Function 12h
Classification   PRINTER BIOS
Name             Get status
Target           Normal, High Resolution, PC-98LT HA
Input            AH=12h
Output           ■Simple Centronics mode
                   AH=End status
                     00h: Printer BUSY
                     01h: Data can be sent
                 ■Full Centronics mode
                   AH=End status
                     00h: Printer BUSY
                     01h: Data can be sent
                     03h: Offline
                     04h: Paper end
                     05h: Printer not connected or power OFF
                   AL=Printer port status
                     bit 7: SELECT
                       1 = SELECT is inactive (offline)
                       0 = SELECT is active (online)
                     bit 6: FAULT
                       1 = FAULT is inactive
                       0 = FAULT is active (cannot print)
                     bit 5: PE
                       1 = PE is inactive
                       0 = PE is active (out of paper)
                     bit 4: DC+5V
                       1 = DC+5V is inactive (power OFF)
                       0 = DC+5V is active (power ON)
                     bit 3: INPUT BUSY
                       1 = INPUT BUSY is inactive
                       0 = INPUT BUSY is active
                       * IEEE STD 1284 equipped devices are linked to BUSY
                     bit 2: BUSY
                       1 = BUSY is inactive (data reception possible)
                       0 = BUSY is active (data reception not possible)
                     bit 1: ACK-R
                       1 = ACK-R is active
                       0 = ACK-R is inactive
                       * IEEE STD 1284 equipped devices are always 0
                     bit 0: ACK
                       1 = ACK is inactive
                       0 = ACK is active
Explanation    o Notifies the printer status.
               o In simple Centronics mode, if the printer power is OFF or the printer is not connected,
                 this is not detected and AH=01h is returned. Simple Centronics mode can only detect the BUSY state.
Related          I/O 0042h
                 I/O 0141h[IEEE STD 1284 equipped machine]


INT 1Ah - Function 13h
Classification   PRINTER BIOS
Name             No function
Target           Normal, High-Resolution, PC-98LT/HA
Input            AH=13h
Output           None
Explanation    o
Related


INT 1Ah - Function 14h
Classification   PRINTER BIOS
Name             Data output (no wait mode)
Target           High-Resolution
Input            AH=14h
                 AL=Data to be output
Output           AH=End status
                   00h: Data transmission complete
                   02h: Unable to transmit due to timeout
                   03h: Offline
                   04h: Paper end
                   05h: Printer not connected or power OFF
                 AL=Printer port status (see INT 1Ah - Function 12h)
Explanation    o When data can be sent to the printer, 1 byte of data is output.
               u This function performs the following process.
                 1. First, check the printer status.
                 2. If the status is 00h (data can be sent), jump to the processing routine INT 1Ah - Function 11h.
                 3. If the status is 01h (BUSY), first execute INT 1Fh - Function 82h with AL = 08h. Then jump to the processing routine INT 1Ah - Function 11h.
                 4. If the status is any other value, set the end status (03-05h) in AH and return.
Related          INT 1Ah - Function 11h
                 INT 1Fh - Function 82h


INT 1Ah - Function 15h
Classification   PRINTER BIOS
Name             Data output (checkless mode)
Target           Hi-Res
Input            AH=15h
                 AL=Data to be output
Output           AH=End status
                   00h: Data transmission complete
                   01h: BUSY
                   03h: Offline
                   04h: Paper end
                   05h: Printer not connected or power OFF
                 AL=Printer port status (see INT 1Ah - Function 12h)
Explanation    o Sends 1 byte of data without checking the printer status.
               u End status/Printer port status is the printer status immediately after data output.
Related


INT 1Ah - Function 16h
Classification   PRINTER BIOS
Name             Initialization (wait time setting)
Target           Hi-Res
Input            AH=16h
                 CX=Printer BUSY timeout time (unit: 10ms)
                   * If set to 0000h, there will be no timeout
Output           AH=End status
                   00h: Data can be sent
                   01h: BUSY
                   03h: Offline
                   04h: Paper end
                   05h: Printer not connected or power OFF
                 AL=Printer port status (see INT 1Ah - Function 12h)
Explanation    o Initializes the printer interface. The processing is the same as INT 1Ah - Function 10h, except that the timeout time when the printer is BUSY can be set.
               o The current printer status is returned to AH and AL.
Related          0000:041Ch
                 INT 1Ah - Function 10h


INT 1Ah - Function 17h
Classification   PRINTER BIOS
Name             Printer interface full Centronics
Target           PC-H98 normal, IEEE STD 1284 equipped machine
Input            AH=17h
Output           AH=End status
                   00h: Data can be sent
                   01h: BUSY
                   03h: Offline
                   04h: Paper end
                   05h: Printer not connected or power OFF
                   06h: Mode error ■[IEEE STD 1284 equipped machine only]
                   AL=Printer port status (see INT 1Ah - Function 12h)
Explanation    o Switches the printer interface to full Centronics mode and performs initialization.
                 The initialization process is the same as INT 1Ah - Function 10h.
               o Can be used when the result of INT 1Ah - Function 19h is "Full Centronics available".
               u For machines equipped with IEEE STD 1284, if a printer interface conversion adapter
                 (a connector that converts the main unit's 36P half-pitch Amphenol to 14P or 20P for simple Centronics) is installed, a mode error will occur.
               o AH and AL return the current printer status.
Related          0000:0458h bit 2,1
                 0000:05B3h [IEEE STD 1284 equipped machine]
                 INT 1Ah - Function 10h
                 INT 1Ah - Function 19h
                 INT 1Ah - Function 1Ah
                 I/O 0448h [PC-H98]
                 I/O 0149h [IEEE STD 1284 equipped machine]


INT 1Ah - Function 18h
Classification   PRINTER BIOS
Name             Status acquisition
Target           PC-H98 normal, IEEE STD 1284 equipped machine
Input            AH=18h
Output           AH=End status
                   00h: Data transmission completed
                   01h: BUSY
                   03h: Offline
                   04h: Paper end
                   05h: Printer not connected or power off
                   06h: Mode error ■[IEEE STD [Only for 1284-equipped machines]
                 AL=Printer port status (see INT 1Ah - Function 12h)
Explanation    o Returns the status in full Centronics mode, regardless of the current mode (simple or full Centronics).
               o Can be used when the result of INT 1Ah - Function 19h is "Full Centronics available".
               u For IEEE STD 1284-equipped machines, if a printer interface conversion adapter (a connector that
                 converts the main unit's 36P half-pitch Amphenol to 14P or 20P for simple Centronics) is installed, a mode error will occur.
Related          INT 1Ah - Function 19h


INT 1Ah - Function 19h
Classification   PRINTER BIOS
Name             Get printer mode
Target           Normal, High Resolution, PC-98LT/HA
Input            AH=19h
Output           AH=Mode information
                   bit 7: IEEE STD 1284 usable flag (Undocumented)
                     1 = Input/output possible
                         (INT 1Ah - Function 1Bh usable)
                     0 = Output only
                         (INT 1Ah - Function 1Bh not usable)
                   bit 6,5: IEEE STD 1284 mode ■ [IEEE STD 1284 equipped machines only] (Undocumented)
                     01b = Input/output mode
                           (INT 1Ah - Function 1C to 1Dh usable)
                     00b = Compatible mode
                           (INT 1Ah - Function 1C to 1Dh not usable)
                   bit 1: Current printer interface mode
                     1 = Full Centronics mode
                     0 = Simple Centronics mode
                   bit 0: Full Centronics available flag
                     1 = Full Centronics available
                         (INT 1Ah - Functions 17 to 1Ah available)
                     0 = Full Centronics unavailable
                         (INT 1Ah - Functions 17 to 1Ah unavailable)
Explanation    o Gets the printer interface capabilities and current mode.
                 Full Centronics is available for PC-H98 normal and IEEE STD 1284 equipped models.
                 IEEE STD 1284 I/O mode is available only for IEEE STD 1284 equipped models.
               u For IEEE STD 1284 equipped models, if a printer interface conversion adapter
                 (connector that converts the main unit's 36P half-pitch Amphenol to 14P or 20P for simple Centronics) is installed,
                 it cannot be switched to full Centronics mode or I/O mode.
                 However, this function returns a result indicating that it is available, so be careful.
               o When a 98 Hi-Res board (PC-9821A-E02) is installed in a PC-9821Ap2/As2, AH=00h is returned.
                 This is because the printer port on the 98 Hi-Res board is used regardless of whether normal mode or high-res mode is selected.
               o AH=00h is always returned when executed on a machine other than a PC-H98 normal/IEEE STD 1284 equipped machine.
Related          0000:0458h
                 0000:05B3h[IEEE STD 1284 equipped devices]
Table            ■Each mode of IEEE STD 1284 equipped devices and the results of INT 1Ah - Function 19h
                 ----------------------------------+----------------------------------------
                 Mode setting method               | INT 1Ah - Function 19h mode information
                                                   +---------+------------------------------
                                                   | bit 6,5 | bit 1
                 ----------------------------------+---------+------------------------------
                 Simple Centronics (initial state) | 00b     | 0b
                 ----------------------------------+---------+------------------------------
                 Full Centronics mode              |         |
                 (INT 1Ah - Function 17h)          | 00b     | 1b
                 ----------------------------------+---------+------------------------------
                 Simple Centronics mode            |         |
                 (INT 1Ah - Function 1Ah)          | 00b     | 0b
                 ----------------------------------+---------+------------------------------
                 I/O mode                          |         |
                 (INT 1Ah - Function 1Bh)          | 01b     | 1b
                 ----------------------------------+---------+------------------------------


INT 1Ah - Function 1Ah
Classification   PRINTER BIOS
Name             Printer interface simplified Centronics
Target           PC-H98 normal, IEEE STD 1284 equipped machine
Input            AH=1Ah
Output           ■IEEE STD 1284 equipped machine
                   AH=End status
                     00h: Printer BUSY
                     01h: Data transmission possible
                 ■PC-H98
                   AH=00h
Explanation    o Sets the printer interface to simplified Centronics mode.
               o IEEE STD 1284 equipped machines also perform the same initialization process as INT 1Ah - Function 10h.
                 As a result, the current printer status is returned to AH.
               o Can be used when the result of INT 1Ah - Function 19h is "Full Centronics available."
Related          0000:0458h
                 0000:05B3h
                 INT 1Ah - Function 17h
                 INT 1Ah - Function 19h


INT 1Ah - Function 1Bh
Classification   PRINTER BIOS
Name             Printer interface I/O
                 Undocumented
Target           IEEE STD 1284 equipped device
Input            AH=1Bh
Output           AH=End status
                   00h: Data can be sent
                   01h: BUSY
                   03h: Offline
                   04h: Paper end
                   05h: Printer not connected or power OFF
                   06h: Mode error
                 AL=Printer port status (see INT 1Ah - Function 12h)
Explanation    o Sets the printer interface to I/O mode. INT 1Ah - Function 1Ch, 1Dh become available.
               o AH, AL return the current printer status.
               o Can be used when the result of INT 1Ah - Function 19h is "Input/Output Available".
               u For machines equipped with IEEE STD 1284, if a printer interface conversion adapter (a connector that
                 converts the main unit's 36P half-pitch Amphenol to 14P or 20P for simplified Centronics) is installed, a mode error will occur.
               u Even in input/output mode, output functions such as INT 1Ah - Function 11h can be used.
                 In this case, the exit status will be the same as in full Centronics mode.
Related          0000:0458h
                 0000:05B3h


INT 1Ah - Function 1Ch
Classification   PRINTER BIOS
Name             Check the transfer function of the connected device
                 Undocumented
Target           IEEE STD 1284 equipped devices
Input            AH=1Ch
Output           AH=Exit status
                   00h: Normal end
                   06h: Mode error (not set to I/O mode)
                     ■When AH=00h
                       AL=Transfer function of the device connected to the printer port
                         bit 1=1: Input from the printer port is possible in byte mode
                           0: Input from the printer port is not possible in byte mode
                         bit 0=1: Input from the printer port is possible in nibble mode
                           0: Input from the printer port is not possible in nibble mode
Explanation    o It seems to be a function to check the transfer function of the device connected to the printer port. Details unknown.
               o Available when INT 1Ah - Function 1Bh is executed and set to "I/O mode".
Related          INT 1Ah - Function 19h
                 INT 1Ah - Function 1Dh


INT 1Ah - Function 1Dh
Classification   PRINTER BIOS
Name             Data input
                 Undocumented
Target           IEEE STD 1284 equipped devices
Input            AH=1Dh
                 AL=Input type
                   01h: Nibble mode (4bit x 2)
                   02h: Byte mode (8bit x 1)
Output           AH=End status (see INT 1Ah - Function 12h)
                   ■When AH≠06h
                     AL=Printer port status (see INT 1Ah - Function 12h)
                     BH=Input type
                       01h: Nibble mode (4bit x 2)
                       02h: Byte mode (8bit x 1)
                     BL=Received data
                   ■When AH=06h (mode error)
                     BH=End status (INT 1Ah - Function 12h)
                     BL=Printer port status (see INT 1Ah - Function 12h)
Explanation    o Input from the printer interface. Details unknown.
               o In nibble mode, the printer port status signal line is used to receive 1 byte of data in two separate transfers.
                 In byte mode, the printer port data signal line is reversed from the output direction, and 1 byte of data is received in one transfer.
               o Available when INT 1Ah - Function 1Bh is executed and set to "I/O mode".
                 A mode error occurs when other than I/O mode or when executed with AL=01h, 02h or other than AL=01h, 02h.
Related          INT 1Ah - Function 19h
                 INT 1Ah - Function 1Ch


INT 1Ah - Function 30h
Classification   PRINTER BIOS
Name             Multi-byte data output
Target           Normal, High Resolution, PC-98LT/HA
Input            AH=30h
                 CX=Output data length
                 ES:BX=First address of data buffer
Output           ES:BX=Next address of data that has been sent
                 CX=Unoutput data length (0000h for normal end)
                   ■In simple Centronics mode
                     AH=End status
                       00h: Data transmission complete
                       02h: Timeout (unoutput data exists)
                     AL=Undefined
                   ■Full Centronics mode
                     AH=End status
                       00h: Data transmission complete
                       02h: Unable to transmit due to timeout
                       03h: Offline
                       04h: Paper end
                       05h: Printer not connected or power OFF
                     AL=Printer port status (see INT 1Ah - Function 12h)
Explanation    o Outputs data stored in the buffer to the printer.
               u Note that the exit status in normal mode is different from INT 1Ah - Function 11h.
               o In simple Centronics mode, if the printer is turned off or not connected, this is not detected, so the
                 command returns with AH=00h. Simple Centronics mode can only detect the BUSY state.
Related          INT 1Ah - Function 11h